package com.caration.shell.workspace2D;

import android.content.Context;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.widget.FrameLayout;

import com.caration.shell.utils.Reflect;

public class DragLayer extends FrameLayout {
	DragController mController;

	public DragLayer(Context context) {
		super(context);
		Reflect.setMotionEventSplittingDisable(this);
	}

	public final void setController(DragController controller) {
		mController = controller;
	}

	public final boolean dispatchKeyEvent(KeyEvent keyevent) {
		if (mController.ignoreKeyEvent() || super.dispatchKeyEvent(keyevent))
			return true;
		else
			return false;
	}

	public final boolean dispatchUnhandledMove(View view, int i) {
		return mController.dispatchUnhandledMove(view, i);
	}

	public final boolean onInterceptTouchEvent(MotionEvent motionevent) {
		return mController.onInterceptTouchEvent(motionevent);
	}

	public final boolean onTouchEvent(MotionEvent motionevent) {
		return mController.onTouchEvent(motionevent);
	}
}
